/*
2022-2-27 
https://leetcode-cn.com/problems/counting-words-with-a-given-prefix/submissions/
*/
class Solution {
public:
    int prefixCount(vector<string>& words, string pref) {
        int len=pref.length();
        int res=0;
        for(int i=0;i<words.size();i++)
            if(words[i].substr(0,len)==pref)
                res++;
        return res;
    }
};
